package com.kevin.model;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import lombok.Data;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.Many;
import org.nutz.dao.entity.annotation.ManyMany;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

/**
 * 文章类
 * 
 * @author Administrator
 * 
 */
@Table("t_article")
public @Data class Article implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 879047567257454110L;
	/*
	 * 数据库ID
	 */
	@Id
	private int id;
	/*
	 * 文章标题
	 */
	@Column("article_title")
	private String title;
	/*
	 * 关键字
	 */
	@Column("article_keywords")
	private String keywords;
	
	/*
	 * 文章内容
	 */
	@Column("article_content")
	private String content;
	/*
	 * 文章来源
	 */
	@Column("article_source")
	private String source;
	/*
	 * 文章作者
	 */
	@Column("article_author")
	private int author;
	
	@One(target = UserInfo.class, field = "author")
	private UserInfo addUser;
	/*
	 * 创建日期
	 */
	@Column("article_createDate")
	private Date createDate;
	/*
	 * 修改日期
	 */
	@Column("article_modifyDate")
	private Date modifyDate;
	/*
	 * 点击率
	 */
	@Column("article_click")
	private int click;
	/*
	 * 是否置顶
	 */
	@Column("article_top")
	private boolean top;
	/*
	 * 文章标题颜色
	 */
	@Column("article_color")
	private String color;
	/*
	 * 是否显示该文章
	 */
	@Column("article_show")
	private boolean show;
	/*
	 * 文章类型
	 */
	@ManyMany(target = NavModel.class, from = "article_id", relation = "t_article_nav", to = "navmodel_id")
	private List<NavModel> nav;
	/*
	 * 文章详细显示的风格
	 */
	@One(target = Templete.class, field = "styleid")
	private Templete style;
	/*
	 * 模版的Id
	 */
	@Column
	private int styleid;
	/*
	 * 文章是否审核
	 */
	@Column
	private boolean shenhe;
	/*
	 * 文章类型
	 */
	@One(target=ArticleType.class,field="typeid")
	private ArticleType type;
	/*
	 * 文章类型id
	 */
	@Column
	private int typeid;
	/*
	 *是否为图片新闻
	 */
	@Column
	private boolean hasPic;
	
	/*
	 * 文章的附件
	 */
	@Many(target=ArticleFile.class,field="aid")
	private List<ArticleFile> files;
	
	
	
	
	
	
}
